package httpserver.general;

import java.util.ArrayList;

public class HTTPMethods {

    public static final String GET = "GET";
    public static final String HEAD = "HEAD";
    public static final String POST = "POST";
    public static final String OPTIONS = "OPTIONS";
    public static final String PUT = "PUT";
    public static final String PATCH = "PATCH";
    public static final String DELETE = "DELETE";
    public static final String TRACE = "TRACE";
    public static final String LINK = "LINK";
    public static final String UNLINK = "UNLINK";
    public static final String CONNECT = "CONNECT";

    private static ArrayList<String> methods = new ArrayList<String>() {{
        add(GET);
        add(HEAD);
        add(POST);
        /*add(OPTIONS);
        add(PUT);
        add(PATCH);
        add(DELETE);
        add(TRACE);
        add(LINK);
        add(UNLINK);
        add(CONNECT);*/
    };};

    public static boolean hasMethod(String method){
        if(methods.contains(method)){
            return true;
        }
        return false;
    }

}
